/**
 * Created by lihongbo on 2018/3/12.
 * 1rem = 10px
 */
// 获取屏幕宽度(viewport)
var htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;

// 获取html的dom
var htmlDom = document.getElementsByTagName('html')[0];

// 设置html的font-size  750px的h5设计稿,最佳适配375px(iphone 6)
htmlDom.style.fontSize = htmlWidth / 37.5 + 'px';

window.addEventListener('resize',function(e){
  // 获取屏幕宽度(viewport)
  var htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
  htmlDom =  htmlWidth / 37.5 + 'px';
})
